-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ (go/v4): Allows container tool to be configured in Makefile #3371
✨ (go/v4): Allows container tool to be configured in Makefile #3371
Conversation
redhatrises
commented
Apr 27, 2023
- This allows building with other container tools like podman. Keeps docker as the default.
|
Welcome @redhatrises! |
Hi @redhatrises. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -71,6 +71,10 @@ else | |||
GOBIN=$(shell go env GOBIN) | |||
endif | |||
|
|||
# CONTAINER_TOOL defines the container tool to be used for building images. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All makefile targets does not work with ANY other container tool
For example docker-buildx: test ## Build and push docker image for the manager for cross-platform support
will really work within any container tool or podman?
So, if you would like to create the env var here it is fine but I do not think that we can say that it can be used with podman . Also, we would need to highlight that it is only tested/support with docker by default. We do not test other tools within.
Is that make sense?
Therefore, if we provide the further clarifications I am OK within.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @camilamacedo86
Iirc podman does have a buildx subcommand, but I agree as well that not all container tools will support all Makefile targets. Where would you prefer to add verbiage on this? Where the $CONTAINER_TOOL variable is set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @redhatrises,
Thank you for the contribution and for share that.
Please, feel free to wording it as you see fit. I think anything like follows would be great.
CONTAINER_TOOL defines the container tool to be used for building images. Be aware that the target commands are only tested with Docker which is scaffolded by default. However, you might want to replace it to use other tools. (i.e. podman)
Also, could you please only apply the change in the go/v4 plugin?
The plugin v3 is deprecated so ideally we should only perform changes on it if is some critical bug. So we avoid introduce regressions either motivate users to upgrade their projects.
Again, thank you a lot for your contribution 🥇
/ok-to-test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on taking in a build-cmd directly? Something like this. If the user provides an entire cmd through an envVar we run it, or we default to docker commands. This will enable customizations on path of where binary can be located too.
cc: @camilamacedo86
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @redhatrises,
Thank you for the contribution and for share that. Please, feel free to wording it as you see fit. I think anything like follows would be great.
CONTAINER_TOOL defines the container tool to be used for building images. Be aware that the target commands are only tested with Docker which is scaffolded by default. However, you might want to replace it to use other tools. (i.e. podman)
Also, could you please only apply the change in the go/v4 plugin? The plugin v3 is deprecated so ideally we should only perform changes on it if is some critical bug. So we avoid introduce regressions either motivate users to upgrade their projects.
Again, thank you a lot for your contribution 🥇
/ok-to-test
@camilamacedo86 I added your wording, because it works well. I also removed updates to the v3 plugin.
@@ -11,6 +11,10 @@ else | |||
GOBIN=$(shell go env GOBIN) | |||
endif | |||
|
|||
# CONTAINER_TOOL defines the container tool to be used for building images. | |||
# You can use docker or podman | |||
CONTAINER_TOOL ?= docker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen this pattern be successful and useful in other projects. It uses podman if it's installed, otherwise defaults to docker. That seems to match people's usage fairly well, because typically the only reason someone appears to have both installed is if they use podman and have some sort of alias of docker to podman (see dnf info podman-docker
for example).
CONTAINER_TOOL=$( command -v podman &> /dev/null && echo "podman" || echo "docker")
- This allows building with other container tools like podman. Keeps docker as the default. Signed-off-by: Gabe Alford <redhatrises@gmail.com>
d16c021
to
1075dbf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution 🥇
/lgtm
/approved
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86, redhatrises The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |